const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

// console.log('process',process);
module.exports = {
  publicPath: './',
  assetsDir: './',
  productionSourceMap: false,
  devServer: {
	  	host: 'localhost',
		// port: 80,
		disableHostCheck: true,
		proxy: {
      		'/apiolddev': {
				target: 'https://apidev.morewellness.cn',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apiolddev': ''
				}
			},
			'/apirestdev': {
				target: 'https://apihealthdev.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apirestdev': ''
				}
			},
      		'/apiold': {
				target: 'https://apitest.morewellness.cn',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apiold': ''
				}
			},
			'/apirest': {
				target: 'https://apihealthtest.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apirest': ''
				}
			},
			'/apirestprod': {
				target: 'https://apihealth.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apirestprod': ''
				}
      		},
			'/apioldprod': {
				target: 'https://api.morewellness.cn',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apioldprod': ''
				}
			},
      		'/apiimdev': {
				target: 'https://imhealthdev.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apiimdev': ''
				}
      		},
 			'/apiim': {
				target: 'https://imhealthtest.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apiim': ''
				}
			},
			'/apiimprod': {
				target: 'https://imhealth.miaomore.com',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/apiimprod': ''
				}
			},
			'/imapiwechatdev': {
				target: 'https://wechatapidev.morewellness.cn/web/api',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/imapiwechatdev': ''
				}
			},
			'/imapiwechat': {
				target: 'https://wechatapitest.morewellness.cn/web/api',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/imapiwechat': ''
				}
			},
			'/imapiwechatprod': {
				target: 'https://wechatapi.morewellness.cn/web/api',
				changeOrigin: true,
				secure: true,
				pathRewrite: {
					'^/imapiwechatprod': ''
				}
			},
		}
	},
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('tim', resolve('src/tim.js'))
  },
  css: {
    loaderOptions: {
      sass: {
				// import: [path.resolve(__dirname, './src/assets/css/base.scss')]
				data: `@import "~@/assets/css/var.scss";`
      }
    }
  }
}
